package com.zhengshang.quartz.task;

import com.zhengshang.api.domain.AppAdvertisementRecord;
import com.zhengshang.api.service.IAppAdvertisementRecordService;
import com.zhengshang.common.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定时任务调度测试
 * 
 * @author ruoyi
 */
@Component("advertisementTask")
public class AdvertisementTask
{
    protected final Logger logger = LoggerFactory.getLogger(AdvertisementTask.class);
    @Autowired
    private IAppAdvertisementRecordService appAdvertisementRecordService;

    /**
     * 设置失效数据状态
     */
    public void setInvalidData()
    {
        logger.info("<advertisementTask.delInvalid>开始执行");
        AppAdvertisementRecord appAdvertisementRecord = new AppAdvertisementRecord();
        appAdvertisementRecord.setUpdateTime(DateUtils.getNowDate());
        appAdvertisementRecord.setState("2");
        appAdvertisementRecordService.setInvalidData(appAdvertisementRecord);
    }

}
